﻿var windowwidth;
$(document).ready(function (e) {

    var scrllTopz = $(window).scrollTop(); /////获取scrollTop///////////
    var scrllTopz_prev = 0;
    var marinposti = [];
    var setInterTime;
    var setInterTime2;
	windowwidth=$(window).width();
    $(window).scroll(function () {
		windowwidth=$(window).width();
        scrllTopz = $(window).scrollTop(); /////获取scrollTop///////////
        scrolBackmarin(); //////版块1///////
        scrolBackmarin2(); /////版块2///////

        WebprocessLc(); ////Wbe流程//////

    });

    init();
    function init() {

        WebprocessLc(); ////Wbe流程//////	


    }


    /////1/////////
    function scrolBackmarin() {
        var minscroTp = Math.min(scrllTopz, 947);
        $(".backImgY4").css({ marginTop: -minscroTp })
        $(".backImgY3").css({ marginTop: -minscroTp * 0.7 })
        $(".backImgY2").css({ marginTop: -minscroTp * 0.5 })
        $(".backImgY1").css({ marginTop: -minscroTp * 0.3 })
    }



		  quehuanIntUl(1);
            $(".DtiasNv a").click(function () {
                var intsx = $(".DtiasNv a").index(this);
                quehuanIntUl(intsx);
            })


            function quehuanIntUl(ins) {
                $(".serveAppBk5").hide();
                $(".serveAppBk5").eq(ins).show();
                $(".DtiasNv a").removeClass("curensQhs").eq(ins).addClass("curensQhs");
            }


    /////1***///////// 
    /////2/////////
    var OffstRtop = $(".serveAppBk2").offset().top;
    function scrolBackmarin2() {
        var minscroTp = Math.min(Math.abs(OffstRtop - scrllTopz), 280) / 2;
        $(".serveAppBk2H .back").css({ width: 540 - minscroTp, height: 177 - minscroTp / 540 * 177, left: minscroTp / 2, top: minscroTp / 540 * 177 / 2 });
        $(".MterbottomMtl2img").css({ left: scrllTopz * 0.05 - 5000 });
        $(".ImgbottomMterl2A").css({ left: -scrllTopz * 3 });
        $(".ImgbottomMterl2B").css({ left: -scrllTopz * 5 });
        var windowWdt = $(window).width();
        if (windowWdt >= 1000) {
			//var serveApas=Math.max($(".serveAppBk2").offset().top-scrllTopz,0);
            var minscroTpa = Math.max($(".serveAppBk2").offset().top - scrllTopz, 0) / 2;
			$(".serveAppBk2 .websolution").css({top:-minscroTpa*0.7});
			$(".serveAppBk2 .serveAppBk2_btn").css({top:-minscroTpa*0.6});
			$(".serveAppBk2 .serveAppBk2_Pic_box").css({top:-minscroTpa*0.4});
			
            $(".serveAppBk2_Picul li").each(function (index, element) {
                if (index % 4 > 1) {
                    $(this).css({ left: (index % 4 - 1) * minscroTpa / (1 + Math.floor((index) / 4)) * 0.5, opacity: Math.abs(300 - Math.min(Math.abs((index % 4 - 1) * minscroTpa / (1 + Math.floor((index) / 4)) * 0.5), 300)) / 300 });
                } else {
                    $(this).css({ left: (index % 4 - 2) * minscroTpa / (1 + Math.floor(index / 4)) * 0.5, opacity: Math.abs(300 - Math.min(Math.abs((index % 4 - 2) * minscroTpa / (1 + Math.floor(index / 4)) * 0.5), 300)) / 300 });
                }

            });
        } else {
            $(".serveAppBk2_Picul li").css({ left: 0 });
			$(".serveAppBk2 .websolution").css({top:0});
			$(".serveAppBk2 .serveAppBk2_btn").css({top:0});
			$(".serveAppBk2 .serveAppBk2_Pic_box").css({top:0});
        }

    }
    /////2***/////////


});
function WebprocessLc() {
    scrllTopz = $(window).scrollTop();
	var serveApas=Math.max($(".WebprocessLc").offset().top-scrllTopz,0);
	if(windowwidth>1000){
		
			
			$(".WebprocessLc .serveAppBk2H").css({top:-serveApas*0.6});
			$(".WebprocessLc .serveAppBk4_p").css({top:-serveApas*0.5});
			$(".WebprocessLc .serveAppBk2_btn").css({top:-serveApas*0.4});
			$(".WebprocessLc .WebprocessPic").css({top:-serveApas*0.3});
		}else{
			$(".WebprocessLc .serveAppBk2H").css({top:0});
			$(".WebprocessLc .serveAppBk4_p").css({top:0});
			$(".WebprocessLc .serveAppBk2_btn").css({top:0});
			$(".WebprocessLc .WebprocessPic").css({top:0});
		}
    $(".Pic_line").each(function (index, element) {
        var thisTop = serveApas;
        var zhideng = Math.min(thisTop - scrllTopz, 300);
        var minzhi = Math.max(zhideng, 0);
        $(this).css({ left: -minzhi / 2 + "%" });
        $(".Pic_adorn").eq(index).css("opacity", 1 - thisTop/100)
        if ($(".WebprocessPic").height() < 300) {
            var thisTopA = $(this).offset().top - 900;
            var zhidengA = Math.min(thisTopA - scrllTopz, 200);
            var minzhiA = Math.max(zhidengA, 0);
            $(".WebprocessPic_ul li").eq(index * 2).css("opacity", 1 - thisTop/100*index)
            $(".WebprocessPic_ul li").eq(index * 2 + 1).css("opacity",1 - thisTop/100*index)
        } else {
            $(".WebprocessPic_ul li").eq(index * 2).css("opacity", 1 - thisTop/100*index)
            $(".WebprocessPic_ul li").eq(index * 2 + 1).css("opacity",1 - thisTop/100*index)
        }

    });

}